{include file="public/_meta"}

<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 代理管理 <span class="c-gray en">&gt;</span> 代理添加 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">

    <div class="text-c">
        <form action="" method="get">

            <input type="text" name="qqun" id="" value="" placeholder="群号搜索" style="width:250px" class="input-text">
            <input type="text" name="qq" id="" value="" placeholder="代理qq号搜索" style="width:250px" class="input-text">
            <button name="" id="" class="btn btn-success" type="submit"><i class="Hui-iconfont">&#xe665;</i></button>
            <a class="btn btn-primary radius" href="javascript:;" onclick="add('添加Q群代理','{:url("/agent/add")}','400','300')"><i class="Hui-iconfont"></i>
                添加Q群代理
            </a>
        </form>
    </div>
    <div class="Huialert Huialert-warning" style="margin-top: 20px;"><i class="Hui-iconfont"></i>注意：一个Q群只能有一个代理</div>
    <div class="col-xs-12 col-sm-6">
    <table style="margin-top: 0px;" class="table table-border table-bordered table-bg table-hover table-sort table-responsive" >
        <thead>

        <tr>
            <!--<th scope="col" colspan="4"></th>-->
        </tr>
        <tr class="text-c">
            <th width="40">群号</th>
            <th width="50">qq号</th>
            <th width="30">操作</th>
        </tr>
        </thead>
        <tbody>
        {foreach $data as $k=>$vo}

        <tr>
            <td>{$k}</td>
            <td>{$vo}</td>
            <td class="f-14"><a title="删除" href="javascript:;" onclick="del(this,{$k},{$vo})" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
        </tr>
        {/foreach}
        </tbody>
    </table>
    </div>
</div>
<div id="laypage"></div>

{include file="public/_footer"}
<style>
    .page .pagination li{display: inline;padidng-left:10px;}
    .pagination .active{color:red}
    .pagination .disabled{color:#888888}
</style>
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="{$Think.config.__STATIC__}/hadmin/lib/My97DatePicker/4.8/WdatePicker.js"></script>
<script type="text/javascript" src="{$Think.config.__STATIC__}/hadmin/lib/laypage/1.2/laypage.js"></script>
<script type="text/javascript" src="{$Think.config.__STATIC__}/admin/js/common.js"></script>

<script type="text/javascript">


    function del(obj,qun,qq){
        layer.confirm('确认要删除吗？',function(index){
            $.ajax({
                type: 'POST',
                url: "{:url('/agent/del')}",
                data:{qun:qun,qq:qq},
                dataType: 'json',
                success: function(data){
                    console.log(qun);
                    layer.msg(data.msg,{icon:1,time:1000})
                },
                error:function(data) {
                    console.log(data);
                    layer.msg("网络错误！",{icon:1,time:1000});
                },
            });
        });
    }


</script>


